package ddd.ajava.chapter7.question8;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.Socket;

public class Client {
	public static void main(String[] args) throws Exception{
		Socket socket = new Socket("127.0.0.1",8010); 
		OutputStream out = socket.getOutputStream();
		while(true){
			out.write("ddd.ajava.chapter7.question8.StudentManager.saveStudent({name:”xu”,age:20})".toString().getBytes());
			System.out.println("发出请求");
			out.close();
			InputStream in=socket.getInputStream();
			BufferedReader br=new BufferedReader(new InputStreamReader(in));
			String requestStr=br.readLine();
			System.out.println("收到回复："+requestStr);
//			socket.close();
		}
	}
}
